package com.xd.core.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.Page;
import com.xd.core.business.dto.AccountDto;
import com.xd.core.business.dto.OutInfoAppQuery;
import com.xd.core.business.dto.OutInfoDto;
import com.xd.core.business.dto.OutInfoQuery;
import com.xd.core.business.entity.OutInfo;
import com.xd.core.business.entity.RepaymentSchedule;
import com.xd.core.business.vo.*;
import com.xd.core.company.dto.HomeQueryDto;
import com.xd.core.company.vo.OutCounts;
import com.xd.core.finance.dto.LendingRecordQueryDto;
import com.xd.core.finance.vo.LendingRecordQueryVo;
import com.xd.core.openapi.vo.IncomingIdVo;
import com.xd.core.openapi.vo.OutDetailVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 放款表 服务类
 * </p>
 *
 * @author ZX
 * @since 2025-02-27
 */
public interface IOutInfoService extends IService<OutInfo> {

    Page<OutInfoPageVo> getList(OutInfoQuery query);

    OutInfoVo getOutDetail(Integer id);

    void addOutInfo(OutInfoDto outInfo) throws Exception;

    List<RepaymentSchedule> calculateLoanSchedule(OutInfo outInfo);

    void calculateInsuranceLoanSchedule(OutInfo outInfo, BigDecimal rate);

    OutInfoWindowVo getOutDetail1(Integer id);

    /**
     * @description: 业务账户-放款记录
     * @author: ZCH
     * @date: 2025/3/26 0026 21:03
     * @param: [dto]
     * @return: com.github.pagehelper.Page<com.xd.core.finance.vo.LendingRecordQueryVo>
     **/
    Page<LendingRecordQueryVo> getLendingRecords(LendingRecordQueryDto dto);

    void exportIncomingInfoList(OutInfoQuery query, Integer id);

    OrderDetailIncomingInfoVo getIncomingDetail(Integer id);

    void againOutInfo(OutInfoDto outInfo) throws Exception;


    OutCounts getOutCounts(HomeQueryDto query);

    /**
     * @description: 业务账户放款记录导出
     * @author: ZCH
     * @date: 2025/3/25 0025 10:51
     * @param: [dto, id]
     * @return: void
     **/
    void exportLendingRecords(LendingRecordQueryDto dto, Integer id);

    void updateAccount(AccountDto accountDto);

    Page<OutInsuranceInfoPageVo> outInsuranceInfoList(OutInfoQuery query);

    OutInsuranceInfoVo getInsuranceIncomingDetail(Integer id);

    List<OutInsuranceRecordVo> getOutOrderList(Integer incomingId, String payPass);

    OutInsuranceWindowVo getInsuranceOutWindow(Integer id);

    void insertInsuranceOutInfo(OutInfoDto outInfo) throws Exception;

    void InsuranceAgainOutInfo(OutInfoDto outInfo) throws Exception;

    String goLending(IncomingIdVo incomingIdVo);

    OutDetailVo lendingDetail(Integer incomingId);

    Page<OutInfoPageAppVo> outInfoAppList(OutInfoAppQuery query);

    OutInfoAppVo outInfoAppDetail(Integer incomingId);

    void exportOutInfoAppList(OutInfoAppQuery query, Integer id);
}
